Skip to content

refactor!: move Avatar, Banner and DataTable to MD3 tokens - #5016

Merged
Doberjohn merged 24 commits into
callstack:mainfrom
MrMuzyk:refactor/non-standard-components
Nov 24, 2026
Merged

Doberjohn merged 24 commits into
callstack:mainfrom
MrMuzyk:refactor/non-standard-components

Conversation

@MrMuzyk

@MrMuzyk MrMuzyk commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Moves Avatar, Banner and DataTable onto the MD3 color, shape, motion and typography tokens, the first PR for #4990. The migration guide covers each change.

  • Avatar: primaryContainer with onPrimaryContainer content by default; a custom backgroundColor needs a matching color, now ColorValue. Avatar.Text uses titleMedium.
  • Banner: the standard decelerate and accelerate curves.
  • DataTable: labelMedium, bodyMedium and bodySmall texts, outlineVariant borders, the standard curve for the sort icon.

Related issue

Part of #4990

Screenshots / Videos

Avatar

banner.mp4

DataTable

Test plan

yarn typecheck, yarn lint and yarn test; the Avatar, Banner and DataTable screens on web.

@MikitasK MikitasK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nicely done 👏
just one comment to consider before merge:

Comment thread src/components/Banner.tsx Resolved
Comment thread src/components/Banner.tsx Resolved
oleksandrzavarzin-callstack added a commit to oleksandrzavarzin-callstack/react-native-paper that referenced this pull request Aug 21, 2026
Comment thread src/components/Banner.tsx Resolved
Comment thread src/components/Banner.tsx Resolved
@JKobrynski

Copy link
Copy Markdown
Collaborator

@MikitasK let me know when this is ready for another review!

@JKobrynski JKobrynski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! @satya164 @artus9033 all yours

@JKobrynski

Copy link
Copy Markdown
Collaborator

@MikitasK we've got conflicts

Comment thread src/components/Avatar/AvatarIcon.tsx Resolved
Comment thread src/components/Avatar/AvatarImage.tsx Resolved
Comment thread src/components/Avatar/AvatarText.tsx Resolved
@satya164
satya164 requested a balanced review from Copilot September 15, 2026 20:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@satya164 satya164 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Claude

See the inline comments. (via Claude, verify if it makes sense)

Comment thread docs/6.x/docs/guides/migration.md Resolved
Comment thread src/components/Avatar/utils.ts Resolved
Comment thread src/components/Avatar/AvatarIcon.tsx Resolved
Comment thread src/components/Avatar/AvatarText.tsx Resolved
Comment thread src/components/Avatar/AvatarText.tsx Resolved
Comment thread src/components/Banner.tsx Resolved
Copilot AI balanced review requested due to automatic review settings November 23, 2026 16:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Visual verification covers only web, leaving shared avatar rounding, typography, and animation changes awaiting human validation on iOS and Android with before-and-after checks and a nearby unaffected case.

No open issues 🎉

3 resolved since last review

Review effort: Balanced

@lukewalczak

Copy link
Copy Markdown
Member

/review

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 2 new findings on 98a6ad9. The verdict and the full list are in the summary comment.

Comment thread src/components/Avatar/AvatarIcon.tsx Resolved
Comment thread src/components/Avatar/AvatarText.tsx Resolved
Comment thread docs/6.x/docs/guides/migration.md Resolved
@lukewalczak

Copy link
Copy Markdown
Member

src/components/DataTable/DataTableHeader.tsx L53 and src/components/DataTable/DataTableRow.tsx L69 still use theme.colors.surfaceVariant for borderBottomColor. Divider, Dialog, Chip, Button and SegmentedButtons use outlineVariant for borders and dividers. Since #4990 asks to reuse the color tokens, should the DataTable borders switch to outlineVariant too?

Copilot AI balanced review requested due to automatic review settings November 24, 2026 11:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Web-only validation leaves the cross-platform visual changes without iOS or Android before-and-after evidence, requiring human checks of image rounding, typography at increased font scale, colors, and motion.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 24, 2026 11:59
@MrMuzyk

MrMuzyk commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@lukewalczak Yes, switched DataTable.Header and DataTable.Row to outlineVariant to match Divider, the closest spec component, and noted it in the migration guide.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The migration guide overstates the custom-font warning and needs to distinguish default-only overrides from global font configuration while identifying the relevant variant overrides.

1 open issue

Review effort: Balanced

Comment thread docs/6.x/docs/guides/migration.md Resolved
Updated typography styles for DataTable and Avatar components to use specific font variants. Adjusted border styles for DataTable components.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 12:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because variant promotion can use the wrapper’s theme instead of the child’s explicit theme, causing runtime errors in table titles and pagination labels.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@MrMuzyk
MrMuzyk requested a review from lukewalczak November 24, 2026 12:25
@lukewalczak

Copy link
Copy Markdown
Member

/review

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 0a5ccd6

Since the review of 98a6ad9: 0 new · 0 still open · 2 no longer raised

No open findings.

Not in the reviewers' prompt (2 files)
  • src/components/__tests__/__snapshots__/Avatar.test.tsx.snap: generated or a lockfile, so its lines were left out
  • src/components/__tests__/__snapshots__/DataTable.test.tsx.snap: generated or a lockfile, so its lines were left out

Reviewed with this repository's own Sentinel configuration (e4256fd06b0f).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@Doberjohn Doberjohn changed the title refactor: modernize non standard components to the latest MD3 spec refactor!: move Avatar, Banner and DataTable to MD3 tokens Nov 24, 2026
@Doberjohn
Doberjohn dismissed satya164’s stale review November 24, 2026 13:26

satya164 has stepped away from Paper. The PR now follows this review: no StyleSheet.flatten and no color parsing, and a custom backgroundColor takes a matching color. lukewalczak and Doberjohn approved the current head.

@Doberjohn
Doberjohn merged commit 9795ac3 into callstack:main Nov 24, 2026
12 checks passed
Stoneski93 pushed a commit to oleksandrzavarzin-callstack/react-native-paper that referenced this pull request Nov 25, 2026
Add `alt`, `fallback` and `sourceKey` to `Avatar.Image`. A failed image
shows `fallback`, and a changed `sourceKey` retries a function source.

An avatar without a label is not its own focus stop. A labelled avatar
gets `role="img"`, and a described host hides its fallback content.

`Avatar.Text` shows at most two graphemes.

Rebuilt on top of callstack#5016, which owns the avatar colors, so the
automatic contrast handling from earlier revisions is dropped.

Co-authored-by: Norbert Kamieński <norbert.kamienski@callstack.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants